<?php
class ConnexionDataBase {
		private static $_instance;
		static $code = 1;
		public function __construct(){ }
		
		public static function getInstance(){
			
			if(isset(self::$_instance)){
				return self::$_instance;	
			} else {
				try{
					self::$_instance = new PDO(SERVER_DSN,SERVER_USERNAME,SERVER_USERPASS);
					//array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
				}catch(PDOException $e){

					die($e->getMessage());
				}
				return self::$_instance;
			}
		}
		
	}
